<?php
/**
 * Enter description here ...
 * @author Micou13630
 *
 */
class Canvas extends Bones implements IRenderable {
	protected $ID;
	protected $parentElement;

	protected $position;
	protected $left;
	protected $top;

	protected $width;
	protected $minWidth;
	protected $maxWidth;
	protected $defaultWidth;

	protected $height;
	protected $minHeight;
	protected $maxHeight;
	protected $defaultHeight;

	protected $overflow;

	protected $padding;
	protected $margin;
	protected $border;
	protected $backgroundImage;
	protected $backgroundColor;
	protected $backgroundPosition;
	protected $backgroundRepeat;
	protected $showEdges;
	protected $edgeSize;
	protected $styleName;

	protected $layoutAlign;

	protected $contextMenu;

	protected $autoDraw;
	protected $autoShowParent;
	protected $redrawOnResize;

	protected $contents;
	protected $dynamicContents;
	protected $dynamicContentsVars;

	protected $cursor;
	protected $prompt;

	protected $tabIndex;

	protected $showResizeBar;
	protected $showHover;

	protected $disabled;
	protected $destroyed;
	protected $visibility;
	protected $opacity;

	protected $canDrag;
	protected $canDragResize;
	protected $canDragReposition;
	protected $canDragScroll;

	protected $canAcceptDrop;
	protected $canDrop;
	protected $canDropBefore;

	protected $canHover;
	protected $canFocus;
	protected $canSelectText;

	protected $accessKey;
	
	// Function
	protected $click;

	/**
	 * Constrcuteur
	 */
	public function Canvas($id = null) {
		parent::Bones();
		$this->ID = $id;
	}
	
	
	/**
	 * Defini Javascript sur click
	 * @param unknown_type $expression
	 */
	public function setJSClick($expression) {
		$this->click = new FunctionType(array(), $expression);
	}
		
	/**
	 * Implementation de object
	 * @see IRenderable::object()
	 */
	public function object() {
		return get_class($this);
	}

	/**
	 * Implementation de properties
	 * @see IRenderable::properties()
	 */
	public function properties() {
		return parent::getProp($this);
	}
	
	/**
	 * Implementation de scLog
	 * @see IRenderable::scLog()
	 */
	public function scLog() {
		ScCollectionLog::getInstance()->addSc(new ScLog($this->object(), get_object_vars($this)));
	}

	/**
	 * Implementation de render
	 * @see IScreen::render()
	 */
	public function render() {
		$this->scLog();
		return "isc.".$this->object().".create({".$this->properties()."})";
	}
}
?>